﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Adminestrator
/// </summary>
public class Adminestrator : User
{
  
    private Compains _Compains;


    public Compains Compains
    {
        get
        {
            return _Compains;
        }
        set
        {
            _Compains = value;

        }
    }

    public bool AddEmployee()
    {
        if (EmpClass.AddEmp(this) == 1)
            return true;
        else
            return false;
    }

    public bool UpdateEmployee()
    {
        if (EmpClass.UpdateEmp(this) == 1)
            return true;
        else
            return false;
    }

    public bool DeleteEmployee(string Id)
    {   
        if (EmpClass.DeleteEmp(Id) == 1)
            return true;
        else
            return false;
    }

    public DataTable Search(string Field, string value)
    {
        return EmpClass.SearchEmp(Field,value);
    }

    public bool CreateCompain()
    { 
        if (CompaignClass.AddCompaign(Compains) == 1)
            return true;
        else
            return false;
    }

    
    public DataTable SearchCompain(string Field,string value)
    {
        DataTable dt=new DataTable();
        dt=CompaignClass.SearchCompaign(Field,value);
        if (dt != null)
            return dt;
        else
        return new DataTable();
    }

    public bool CancelCompain(string Id)
    {  
        if (CompaignClass.DeleteCompaign(Id) == 1)
            return true;
        else
            return false;
    }
    public bool UpdateCampaign()
    { 
        if (CompaignClass.UpdateCompaign(Compains)== 1)
            return true;
        else
            return false;
    }
    public bool AddComp_Emp(string CompCode,string[] EmpID)
    {
        if (CompaignClass.AddComp_Emp(CompCode, EmpID) == 1)
        {
            return true;
        }
        else
            return false;
    }
}